import { request, request2 } from "./request";

// 首页/swiper
export function getMoviesSwiperAPI(params) {
    return request({
        url: "/gateway",
        params,
        headers: { "X-Host": "mall.cfg.common-banner" }
    })
}
// 首页/NowPlaying
export function getNowPlayingAPI(params) {
    return request({
        url: "/gateway",
        params,
        headers: { "X-Host": "mall.film-ticket.film.list" }
    })
}
// 首页/ComingSoon
export function getComingSoonAPI(params) {
    return request({
        url: "/gateway",
        params,
        headers: { "X-Host": "mall.film-ticket.film.list" }
    })
}
// 详情页
export function getDetailAPI(params) {
    return request({
        url: "/gateway",
        params,
        headers: { "X-Host": "mall.film-ticket.film.info" }
    })
}

// 电影院
export function getCinemaAPI(params) {
    return request({
        url: "/gateway",
        params,
        headers: { "X-Host": "mall.film-ticket.cinema.list" }
    })
}

// 注册
export function getRegisterAPI(params) {
    return request2({
        method: 'post',
        url: '/api/register',
        data: params,
    })
}
// 登录
export function getLoginAPI(params) {
    return request2({
        method: 'post',
        url: '/api/login',
        data: params,
    })
}
// 获取用户信息
export function getUserInfoAPI(id) {
    return request2({
        url: '/api/user/' + id,
    })
}
// 获取上传图片
export function getUploadAPI(params) {
    return request2({
        method: 'post',
        url: '/api/upload',
        data: params,
    })
}
// 修改用户服务器资料
export function getUpdataAPI(url, params) {
    return request2({
        method: 'post',
        url: '/api/update/' + url,
        data: params,
    })
}